<extend name="Public/layout"/>
<block name="head">
    <link rel="stylesheet" href="__PUBLIC__css/apply-pusher-form.css">
        <style type="text/css">
        .footer{
            display: none;
        }
        </style>
</block>
<block name="main">
    <div class="content-top">
        <h3>尊敬的8号街用户：</h3>
        <p class="text">如您想要申请成为8号金融街理财投顾，请您完成以下信息，并阅读《理财投顾声明》勾选同意后，通过邮件或电话联系我们！我们将在3个工作日内完成审核！</p>
        <div class="contact-us">
            <p>商务合作电话：400-999-2337</p>
            <p>商户对接邮件：jhm@8hjie.com</p>
        </div>
    </div>
    <div class="content-middle">
        <div class="form">
            <div class="form-group">
                <div class="left">
                    <span>姓名</span>
                </div>
                <div class="right">
                    <input type="text" name="name" placeholder="请输入您的真实姓名">
                </div>
            </div>
<!--             <if condition="$user['card_status'] eq 0 ">
            <div class="form-group">
                <div class="left">
                    <span>身份证</span>
                </div>
                <div class="right">
                    <input type="text" name="idcard" placeholder="请输入您的身份证号码">
                </div>
            </div>
            </if> -->
           <!--  <div class="form-group">
                <div class="left">
                    <span>手机号</span>
                </div>
                <div class="right">
                    <input type="text" name="phone" placeholder="请输入您的手机号码">
                </div>
            </div> -->
        </div>
    </div>
    <div class="content-bottom">
        <label>
            <input type="checkbox" checked="checked"><span></span>
            <p class="agreement">我已阅读并同意8号金融街《<a href="/Home/Recommend/apply_pusher_notice">理财投顾声明</a>》</p>
        </label>
        <div class="btn-wrapper">
            <a href="javascript:" onTouchStart="sub()">提交申请</a>
        </div>
    </div>
</block>
<block name="js">
    <script>
        function sub() {
            var name = $('input[name="name"]').val();
            var phone = $('input[name="phone"]').val();
            if(!name) {
                layer.open({
                    content:'姓名不能为空'
                    ,skin: 'msg'
                    ,time: 2
                });
                return;
            }
            // if(!(/^1\d{10}$/.test(phone))){
            //     layer.open({
            //         content:'手机号码格式错误，请重新输入'
            //         ,skin: 'msg'
            //         ,time: 2
            //     });
            //     return;
            // }
            var data = {name};
            $.post('{:U("Recommend/push_apply")}',data,function(res) {
                if(res.err==0) {
                    location.href="{:U('Recommend/factions_thunder')}";
                } else {
                    layer.open({
                        content:res.msg
                        ,skin: 'msg'
                        ,time: 2
                    });
                  // location.href="{:U('Recommend/apply_pusher_error')}";
                }
            });
        }
    </script>
</block>